package com.zhuoyian.pluginsdk;

import android.content.Context;
import android.telephony.TelephonyManager;

public class NetworkOperators {

	public static int getSimOperatorInfo(Context con) {
		TelephonyManager telephonyManager = (TelephonyManager) con
				.getSystemService(Context.TELEPHONY_SERVICE);
		String operatorString = telephonyManager.getSimOperator();

		if (operatorString == null) {
			return 0;
		}

		if (operatorString.equals("46000") || operatorString.equals("46002")) {
			// 中国移动
			return 1;
		} else if (operatorString.equals("46001")) {
			// 中国联通
			return 2;
		} else if (operatorString.equals("46003")) {
			// 中国电信
			return 3;
		}

		// error
		return 0;

	}

}
